home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / pc / files / pbbs / src60.arc / MB.H < prev    next >
Text File  |  1989-02-05  |  5KB  |  236 lines

  1.  
  2. /*
  3.  *  MB.H - 1/13/89 - Definitions for MailBox.
  4.  */
  5.  
  6. /*
  7.  *  System specific includes.
  8.  *  IBM PC, Microsoft C Compiler Version 5.00
  9.  */
  10.  
  11. /*
  12.  *  Includes from the C Library.
  13.  */
  14.  
  15. #include <stdio.h>
  16. #include <fcntl.h>
  17. #include <ctype.h>
  18. #include <string.h>
  19. #include <malloc.h>
  20. #include <sys\types.h>
  21. #include <sys\stat.h>
  22.  
  23. #ifndef O_BINARY
  24. #define O_BINARY 0
  25. #endif
  26.  
  27. typedef unsigned char  byte;
  28. typedef unsigned short word;
  29.  
  30. /*
  31.  *  Sizes of things.
  32.  */
  33.  
  34. #define ln_handle 12  /* # chars in users name         */
  35. #define ln_call    6  /* # chars in a callsign         */
  36. #define ln_callp   9  /* # chars in callsign+ssid      */
  37. #define ln_date    6  /* # chars in date               */
  38. #define ln_time    4  /* # chars in time               */
  39. #define ln_zip     6  /* # chars in zip or postal code */
  40. #define ln_bid    12  /* # chars in bulletin ID        */
  41.  
  42. #define maxflds  16
  43.  
  44. /*
  45.  *  MailBox includes.
  46.  */
  47.  
  48. #include "mbmail.h"
  49. #include "mbuser.h"
  50. #include "mbport.h"
  51.  
  52. /*
  53.  *  Cosmetics.
  54.  */
  55.  
  56. #define is   ==
  57. #define isnt !=
  58. #define and  &&
  59. #define or   ||
  60. #define not   !
  61.  
  62. #define setbit  |=
  63. #define clrbit  &= ~
  64. #define flipbit ^=
  65.  
  66. #define true   1
  67. #define false  0
  68. #define match  !strcmp
  69. #define matchn !strncmp
  70.  
  71. #define nncmd false /* If true, enable the "NN" command    */
  72.  
  73. #define RECSIZE 256
  74.  
  75. #define pmode S_IREAD | S_IWRITE  /* Permissions for creat() */
  76.  
  77. /*
  78.  *  Some character values.
  79.  */
  80.  
  81. #define ctl_c  '\03'
  82. #define ctl_g  '\07'
  83. #define ctl_v  '\026'
  84. #define ctl_w  '\027'
  85. #define cpmeof '\032'
  86. #define del     0x7f
  87.  
  88. /*
  89.  *  Index values for standard TNC commands.
  90.  */
  91.  
  92. #define t_con  0  /* Connect on */
  93. #define t_coff 1  /* Connect off */
  94. #define t_mon  2  /* Monitor on */
  95. #define t_moff 3  /* Monitor off */
  96.  
  97. #define cmdlen   80
  98. #define linelen 256
  99.  
  100. extern char scmd[24];
  101. extern char pt_flag;
  102. extern word filesize;
  103.  
  104. /*
  105.  *  Multi-line messages (message of the day, mostly).
  106.  */
  107.  
  108. typedef struct MLM_S
  109. {
  110.   char *text;
  111.   struct MLM_S *next;
  112. } MLM;
  113.  
  114. /*
  115.  *  Directory path stuff.
  116.  */
  117.  
  118. #define dp_dnload 1  /* Ok to download */
  119. #define dp_upload 2  /* Ok to upload   */
  120.  
  121. typedef struct DIRPATH_S
  122. {
  123.   char *name;              /* Name of this directory path */
  124.   char *path;              /* The path or device spec */
  125.   struct DIRPATH_S *next;  /* Pointer to next path */
  126.   byte flags;              /* Flag bits */
  127.   char id;                 /* Path identifier */
  128. } DIRPATH;
  129.  
  130. extern DIRPATH *dphd, *getdir();
  131.  
  132. /*
  133.  *  Directory entry stuff.
  134.  */
  135.  
  136. typedef struct
  137. {
  138.   word size;    /* Device size, in k */
  139.   word block;   /* Device block size */
  140.   word free;    /* Device free space, in k */
  141. } DIRDEF;
  142.  
  143. typedef struct
  144. {
  145.   char name[14];  /* File name */
  146.   short size;     /* File size, in k */
  147. } DIRENT;
  148.  
  149. /*
  150.  *  Scratch area. Used by directory listing commands,
  151.  *  and by user file and message file backup.
  152.  *  Also used hither, and yon.
  153.  */
  154.  
  155. typedef union
  156. {
  157.   char scr[1];
  158.   DIRENT dirent[1];
  159. } TMP;
  160.  
  161. extern int scrmax, dirmax;
  162. extern TMP *tmp;
  163.  
  164. /*
  165.  *  Date and time stuff.
  166.  */
  167.  
  168. extern char l_date[ln_date + 1];
  169. extern char l_time[ln_time + 1];
  170. extern byte unt_hr;
  171.  
  172. /*
  173.  *  File names.
  174.  */
  175.  
  176. extern char *helpfile, *infofile, *fwdfile, *lgfile, *monfile;
  177.  
  178. extern char *hrdfile, *bidfile;
  179. extern int  hrdmax, bidok, hidok;
  180.  
  181. /*
  182.  *  Error / status messages.
  183.  */
  184.  
  185. extern char *mcant, *mfind,  *mprot, *mexst,  *mtime, *mwhat;
  186. extern char *mdone, *mnport, *mndir, *mnfile, *mnmsg, *minuse;
  187.  
  188. /*
  189.  *  Misc text.
  190.  */
  191.  
  192. extern MLM *motd;
  193.  
  194. extern char *nullstr;
  195. extern char *ver;
  196.  
  197. extern char *talkm1, *talkm2, *talkm3, *talkm4;
  198. extern char *bbmenu, *symenu, *rmenus, *mumsg;
  199. extern char *pausemsg, *fm, *reqmsg;
  200. extern char *qth, *keylst;
  201.  
  202. #define num_gm 7
  203. extern char *gm[num_gm];
  204.  
  205. extern char achar, rchar, tchar, wchar;
  206.  
  207. /*
  208.  *  System parameters.
  209.  */
  210.  
  211. #define s_page     0x0001   /* Page sysop enabled ?            */
  212. #define s_cmd      0x0002   /* Delayed remote sysop cmd to do  */
  213. #define s_unt      0x0004   /* Do an automatic untangle        */
  214. #define s_mchange  0x0008   /* Mail file changed?              */
  215. #define s_kill     0x0010   /* Kill all msgs after forward     */
  216. #define s_fkill    0x0020   /* Kill F msgs after forward       */
  217. #define s_svc      0x0040   /* Generate service message on KT  */
  218. #define s_edtfc    0x0080   /* Edit traffic command enabled?   */
  219.  
  220. #define s_log_on   0x0100   /* Logging enabled                 */
  221. #define s_log_gate 0x0200   /* Log gateway events              */
  222. #define s_log_file 0x0400   /* Log file events                 */
  223. #define s_log_msg  0x0800   /* Log message events              */
  224. #define s_log_loc  0x1000   /* Log stuff happens local console */
  225.  
  226. #define s_p_name   0x2000   /* Prompt user to enter name       */
  227. #define s_p_home   0x4000   /* Prompt user to enter bbs        */
  228. #define s_p_zip    0x8000   /* Prompt user to enter zip        */
  229.  
  230. extern word s_param;
  231.  
  232. #define s_update   0x01     /* List update flag                */
  233. #define s_dv       0x02     /* Desqview active, give slice     */
  234.  
  235. extern byte s_flag;
  236.